package com.ns.core.utils.obj;

import com.alibaba.fastjson2.JSON;

import java.util.ArrayList;
import java.util.List;

/**
 * JSON 对象解析
 *
 * @author lw
 * @since 2024-11-16
 */
public class ObjUtil {
    /**
     * 解析数据
     * [["2","1834567533155840002","1834568260422987777"],["2","1834567533155840002","1834567800655966209"],["2","1834574160462274562","1841666937510604802"],["2","1839498120459849729","1839498478036848641"],["2","1839498120459849729","1839498771340333057"]]
     *
     * @param param 参数
     * @return String
     */
    public static List<List<String>> getList(String param) {
        List<List<String>> list = new ArrayList<>();
        if (JSON.isValid(param)) {
            for (Object m : JSON.parseArray(param)) {
                List<String> l = new ArrayList<>();
                for (Object o : JSON.parseArray(JSON.toJSONString(m))) {
                    l.add(String.valueOf(o));
                }
                list.add(l);
            }
        }
        return list;
    }
}
